<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="serviceSupplierId" value="#{serviceSupplierHome.id}"></f:viewParam>
	   	<f:event listener="#{serviceSupplierHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="审核中介用户"></f:viewParam>
   	</f:metadata>
   <ui:define name="head">
   		<script type="text/javascript">
			function start() {
			    PF('statusDialog').show();
			}
			 
			function stop() {
			    PF('statusDialog').hide();
			}
		</script>
   
   </ui:define>
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="中介基本信息查看" style="margin-bottom:10px;">
		       <p:messages id="messages" closable="true"><p:autoUpdate/></p:messages>
		        
		        <ui:include src="../template/include/supplierBaseInfo.xhtml" />
			</p:panel>
			
			<p:panel header="主营业务" style="margin-bottom:10px;">
				<p:repeat var="_business" value="#{serviceSupplierHome.instance.mainBusinesses}" varStatus="_status">
	        		<p:panel header="主营业务#{_status.index + 1}">
	        			<p:panelGrid columns="2" columnClasses="label, value" style="width: 100%">
	        				<p:outputLabel value="服务事项" />	
							<h:outputText 
									   value="#{_business.agentService.name}" />
									   
							<p:outputLabel value="服务时限承诺" />	
							<h:outputText 
									   value="#{_business.commitOfTime}" />
									   
							<p:outputLabel value="服务收费承诺" />	
							<h:outputText 
									   value="#{_business.commitOfPrice}" />
									   
							<p:outputLabel value="服务质量承诺" />	
							<h:outputText 
									   value="#{_business.commitOfQuality}" />
	        			</p:panelGrid>
	        		</p:panel>
	        	</p:repeat>
			</p:panel>
			<p:panel header="相关附件" style="margin-bottom:10px;" rendered="#{serviceSupplierHome.instance.attachments.size() > 0}">   
				<p:panel id="uploadedAttachments">
					<ul>
						<p:repeat var="_attachment"
							value="#{serviceSupplierHome.instance.attachments}">
							<li style="line-height:40px;">
								<h:outputText value="#{_attachment.filename}" />
								<p:commandButton style="margin-left:10px;" value="下载" ajax="false"  icon="ui-icon-arrowthick-1-s">
							        <p:fileDownload value="#{fileDownloadView.download(_attachment)}" />
							    </p:commandButton>
							</li>
						</p:repeat>
					</ul>
				</p:panel>
			</p:panel>
		</h:form>

		<p:dialog
			id="imageDialog"
			widgetVar="imageDialog"
			modal="true"
			width="60%"
		>
			<f:facet name="header">
				营业执照
			</f:facet>
			<p:panel style="text-align: center;">
				<div id="imgsPreview" >
					<img  data-original="#{attachmentUtils.getFullPath(serviceSupplierHome.instance.businessLicenseImages[0])}" src="#{attachmentUtils.getFullPath(serviceSupplierHome.instance.businessLicenseImages[0])}"  id="img" width="240"/>
					
				</div>
			</p:panel>
		</p:dialog>
		
		
	</ui:define>
</ui:composition>
